import React from 'react';
import CommonPage from '@/components/page/CommonPage';

const daoName = "Role";
const columns: API.Column[] =[
  { title: '角色名', 
    dataIndex: 'Name', 
    key: 'Name', 
    width: 120, 
    sorter: true, 
    dispaly: true, 
    filter: true 
  },
  { title: '敏感信息',
    width: 150, 
    sorter: true, 
    key: 'CanIdno', 
    dataIndex: 'CanIndoCaption', 
    dispaly: true, 
    canEdit: true 
  },
  { title: '角色备注', 
    width: 150,
    sorter: true,
    dataIndex: 'RoleDes', 
    key: 'RoleDes', 
    dispaly: true, 
    filter: true 
  },
];
const controls: API.Control[] = [
  { name: 'Name',
    type: 'text', 
    label: '角色名', 
    grid: 12 / 24 ,
    rules: [
      { required: true, message: '员工名称不能为空' },
      { min: 3, max: 12, message: '长度不能小于3，大于12' },
    ],
  },
  { name: "CanIdno", 
    label: "敏感信息", 
    options: [
    { value: 1, label: '可见' }, 
    { value: 0, label: '隐藏' }
  ], 
  grid: 12 / 24, 
  type: "radio-group", 
  layout: { labelSpan: 8, wrapperSpan: 13 },
  rules: [
    { required: true, message: '敏感信息不能为空' },
  ] 
},
  { name: 'RoleDes', 
  type: 'text', 
  label: '角色备注',
  grid: 12 / 24 ,
  rules: [
    { required: true, message: '角色备注不能为空' },
    { min: 3, max: 30, message: '长度不能小于3，大于200' },
  ],
},
];
const Role: React.FC = () => {
  return <CommonPage daoName={daoName} columns={columns} controls={controls} title="角色管理" />;
};

export default Role;